package com.ymttest.database.sqlwapper.hunter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.hunter.HunterSettlementManageFeeDetail;

public class HunterSettlementManageFeeDetailWrapper {
	
	SqlManager manager;

    public HunterSettlementManageFeeDetailWrapper() {
        manager = new SqlManager("tradingsettlement");
    }
    
    @SuppressWarnings("unchecked")
	public List<HunterSettlementManageFeeDetail> selectBySettlementId(String settlementId) {
    	
    	List<HunterSettlementManageFeeDetail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.hunter.HunterSettlementManageFeeDetailMapper.selectBySettlementId",
                        settlementId);
        manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("hunter_settlement_manage_fee_detail没有数据");
		}
		
		return result;
    }
    
    @SuppressWarnings("unchecked")
	public HunterSettlementManageFeeDetail selectByChildHunterIdAndCatalogId(long childHunterId, String catalogId, String settlementId) {
    	
    	Map<String, Object> map = new HashMap<String, Object>();
    	
    	map.put("child_hunter_id", childHunterId);
    	map.put("catalog_id", catalogId);
    	map.put("settlement_id", settlementId);
    	
    	List<HunterSettlementManageFeeDetail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.hunter.HunterSettlementManageFeeDetailMapper.selectByChildHunterIdAndCatalogId",
                        map);
        manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("hunter_settlement_manage_fee_detail没有数据");
		}
		
		return result.get(0);
    }
	
    public static void main(String[] args) {
    	
    	HunterSettlementManageFeeDetailWrapper test = new HunterSettlementManageFeeDetailWrapper();
    	
    	System.out.println(test.selectByChildHunterIdAndCatalogId(20324277, "c3392493", "N_FJY201810103760").getProduct_type());
    }
}
